1. Field of the Invention
The present invention relates to a microcontroller.
2. Description of Related Art
In recent years, various electronic devices such as home appliances are provided with a clock function for displaying date and time, for example. In general, the clock function is achieved when a counter value of a real-time clock (RTC), which is provided in a microcontroller for controlling a device, is read by a CPU that is also provided in the microcontroller.
However, when a main battery or an AC power supply for supplying power to a device is disconnected, or when a voltage supplied from a battery drops, for example, the clock function is reset and forced to stop operating. As a result, in a case where a user or a system of the device uses the clock function again, it is necessary for the user to set time information each time the clock function is reset.
Such a problem arises for the following reason. That is, conventionally, a microcontroller for controlling a device is designed mainly focusing on a central processing unit (CPU) provided therein. Accordingly, in order to prevent runaway of a microcontroller due to a drop in power supply voltage, the microcontroller is designed such that the whole microcontroller is reset and deactivated at about a minimum operation guarantee voltage of the CPU. Further, a reason why the microcontroller is designed focusing on the CPU provided therein is as follows. That is, operations of peripheral functions provided in the microcontroller are controlled in response to signals from the CPU, and values obtained in the peripheral functions are processed by the CPU. Accordingly, when the CPU is reset, the operations of the peripheral functions cannot be controlled and the values obtained in the peripheral functions cannot be used.
As an example of prior art, FIG. 6 shows the configuration of a hardware block such as a microcontroller disclosed in Japanese Unexamined Patent Application Publication No. 2006-79332 (hereinafter, referred to as “prior art”). In the prior art, a reset signal from a reset circuit 540, which receives the reset signal from a reset terminal, is connected to an RTC 560, a CPU 510, and other peripheral functions via a bus. In general, as described above, when the power supply voltage drops, it is necessary to reset the microcontroller at about the minimum operation guarantee voltage of the CPU in order to prevent the runaway of the CPU. As a result, the reset signal from the reset circuit 540 of the prior art is also applied to the whole microcontroller.
In this case, in general, if the microcontroller is not reset as described above, the real-time clock can operate at a voltage lower than that for operating the CPU. This is because, in the operation of the CPU, it is necessary to cause a charge pump and a sense amplifier to operate in a case of reading/writing data from a memory such as a flash read only memory (ROM) or a random access memory (RAM), with the result that a voltage higher than that used only by a logic circuit provided in the CPU is required. On the other hand, the real-time clock formed only with a logic circuit can operate at a lower voltage.
However, the whole microcontroller is reset as described above, so the real-time clock capable of normally operating at a lower voltage is also reset. This is because, as described above, the conventional microcontroller is designed focusing on the CPU. Thus, when a main battery or an AC power supply is disconnected, or when a voltage supply capacity of a battery is lowered, for example, the clock function associated with the real-time clock is also reset. Accordingly, in the case where the user or the system of the device uses the clock function again, it is necessary for the user to set time information again each time the clock function is reset. As a result, user-friendliness in using the device having the microcontroller is impaired.
Further, in case the main power supply is disconnected, or in case the power supply capacity of the battery is lowered, for example, there is provided a device having a charged capacitance used as a backup standby power supply to drive a microcontroller. However, an output voltage drops during a process in which the capacitance is discharged. When the output voltage from the capacitance is reduced to about the minimum operation guarantee voltage of the CPU provided in the microcontroller, even if an electric charge is left in the capacitance, the whole microcontroller is reset.
In this case, in order to operate the RTC at a lower voltage, it is necessary to prepare an external RTC separate from the microcontroller. As a result, it is necessary to prepare another chip, which leads to an increase in manufacturing costs due to an increase in substrate area, an increase in the number of manufacturing processes, and the like.
In view of the foregoing, in order to prevent the increase in manufacturing costs without impairing the user-friendliness, there is a demand for operating a real-time clock for a longer period of time at a lower voltage in a one-chip microcontroller.
In the prior art, the clock function of the real-time clock provided in the microcontroller cannot operate continuously at low voltage. Accordingly, the clock function is reset each time the operation of the CPU mounted on the same chip is reset.